<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<script type="text/javascript">
        $(function(){
            $("#user_list tr:gt(0)").click(function(){
 	    	   if($(this).find(":radio").attr("checked")=="checked"){
 	    		     $(this).find(":radio").attr("checked",false);
 		    	   }else{
 		             $(this).find(":radio").attr("checked",true);
 		    	   }
            });
        });
    </script>
<div class="bjui-pageHeader" style="background:#FFF;">
	<!-- 顶部模块[如：功能按钮、搜索面板] -->
	<form id="pagerForm" data-toggle="ajaxsearch" action="${ctx}/sys/sysUserAction/toList" method="post">
        <input type="hidden" name="pageSize" value="${pageResult.pageSize}">
        <input type="hidden" name="pageCurrent" value="${pageResult.pageCurrent}">
        <input type="hidden" name="orderField" value="${pageResult.orderField}">
        <input type="hidden" name="orderDirection" value="${pageResult.orderDirection}">
         <div style="margin-top: 5px;">
			<button class="btn btn-orange" data-icon="refresh">刷新</button>
			<shiro:hasPermission name="userAdd">
		   	<a href="${ctx}/sys/sysUserAction/toAdd" class="btn btn-green" data-icon="plus" data-toggle="dialog" data-width="800" data-height="400" data-id="dialog-user" data-mask="true">添加</a>
		   	</shiro:hasPermission>
		   	<shiro:hasPermission name="userEdit">
		   	<a href="${ctx}/sys/sysUserAction/toEdit?id={#bjui-selected}" class="btn btn-blue" data-icon="edit" data-toggle="dialog" data-width="800" data-height="400" data-id="dialog-user" data-mask="true">编辑</a>
		   	</shiro:hasPermission>
		   	<shiro:hasPermission name="userDel">
		   	<a href="${ctx}/sys/sysUserAction/doDel?id={#bjui-selected}" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定要删除选中记录吗？" data-icon="remove">删除</a>
		   	</shiro:hasPermission>
		</div>
		<hr style="margin-top: 5px;margin-bottom: 5px">
		<div style="margin-bottom:5px">
		  	<label>帐号：<input id="paramAccount" type="text" name="paramAccount" value="${pageResult.ext.paramAccount}" placeholder="请输入帐号" style="width:140px;"/></label>
		  	<label>姓名：<input id="paramName" type="text" name="paramName" value="${pageResult.ext.paramName}" placeholder="请输入姓名" style="width:140px;"/></label>
		  	<label>电话：<input id="paramTel" type="text" name="paramTel" value="${pageResult.ext.paramTel}" placeholder="请输入电话" style="width:140px;"/></label>
			<label>邮箱：<input id="paramEmail" type="text" name="paramEmail" value="${pageResult.ext.paramEmail}" placeholder="请输入邮箱" style="width:140px;"/></label>
		   	<button class="btn-default" data-icon="search">查询</button>
	   	</div>
   	</form>
</div>
<div class="bjui-pageContent tableContent" id="user_list">
    <!-- 内容区 -->
    <table class="table table-bordered table-hover">
    	<thead>
    		<tr style="height:30px;">
    			<th>状态</th>
	    		<th>编号</th>
	    		<th>账号</th>
	    		<th>姓名</th>
	    		<th>密码</th>
	    		<th>邮箱</th>
	    		<th>电话</th>
	    		<th>描述</th>
    		</tr>
    	</thead>
    	<tbody>
    	<c:forEach items="${pageResult.list}" var="u">
    		<tr data-id="${u.id}">
    			<td><input name="user_radio" type="radio"  /></td>
    			<td>${u.id}</td>
    			<td>${u.account}</td>
    			<td>${u.name}</td>
    			<td>${u.password}</td>
    			<td>${u.email}</td>
    			<td>${u.telephone}</td>
    			<td>${u.description}</td>
    		</tr>
    	</c:forEach>
    	</tbody>
    </table>
</div>
<div class="bjui-pageFooter">
    <!-- 底部模块[如：工具条、分页组件]  -->
    <div class="pages">
	    <span>每页 </span>
	    <div class="selectPagesize">
	        <select data-toggle="selectpicker" data-toggle-change="changepagesize">
	            <option value="10">10</option>
	            <option value="30">30</option>
	            <option value="60">60</option>
	            <option value="100">100</option>
	        </select>
	    </div>
	    <span> 条，共 ${pageResult.total} 条</span>
	</div>
	<div class="pagination-box" data-toggle="pagination" data-total="${pageResult.total}" data-page-size="${pageResult.pageSize}" data-page-current="${pageResult.pageCurrent}"></div>
</div>